package baiju.exception;

public class exceptiondemo {
	
	int a=2;
	int b=0;
	
	public void divide()
	{	
		try{
			System.out.println(a/b);
		}
		catch(ArithmeticException exp1){
			System.out.println("This will throw an error " + exp1.getMessage());
		}
	}

	public static void main(String[] args) {
		
		exceptiondemo expd = new exceptiondemo();
		expd.divide();

	}

}
